﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CinemaBookingWebsite
{
    public partial class Default : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            CinemaWcf.ICinemaWcf cinemaWcf = new CinemaWcf.CinemaWcfClient();

            Repeater1.DataSource = cinemaWcf.GetAllMovies();
            Repeater1.DataBind();

        }

        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Image MovieImg = new Image();
                MovieImg = (Image)e.Item.FindControl("MovieImg");

                if (MovieImg.ImageUrl.Contains("Posters/.jpg"))
                {
                    MovieImg.ImageUrl = "Posters/null.jpg";
                }

            }
        }






    }
}